import json
import time

import requests


def check(phone):
    headers = {
        'orgname': '%E6%B8%A9%E5%B7%9E%E5%B9%B3%E9%98%B3%E4%B8%87%E8%BE%BE%E5%B9%BF%E5%9C%BA',
        'Accept-Encoding': 'gzip, deflate',
        'plazaCode': '1000769',
        'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,ja;q=0.6',
        'orgTypeName': '%E5%B9%BF%E5%9C%BA',
        'userid': '259357274605461504',
        'orgcode': '1000769',
        'orgTypeCode': '10003',
        'Connection': 'keep-alive',
        'workingOrgCode': '1000769',
        'areaCode': '10006',
        'groupCode': '101',
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36',
        'tenantId': '2018092600001',
        'Accept': 'application/json, text/plain, */*',
        'username': '%E6%B8%A9%E5%B7%9E%E5%B9%B3%E9%98%B3%E4%B8%87%E8%BE%BE%E5%B9%BF%E5%9C%BA%E7%AE%A1%E7%90%86%E5%91%98',
        'storeCode': '',
        'Referer': 'http://center.beyonds.com/',
        'centerCode': '1007',
        'token': 'MjczMDc5MjUxMzc2NTI5NDA4',
    }

    params = {
        'pageIndex': '1',
        'pageSize': '10',
        'scope': 'DQFquanjituan',
        'scopeType': '10001',
        'mobileNo': phone,
        'timestr': time.time(),

    }

    response = requests.get('http://center.beyonds.com/member/members', headers=headers, params=params)
    print(response.text)
    return json.loads(response.text)


if __name__ == '__main__':
    check("13408006207")
